@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
  }

  /* 自定义滚动条 */
  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
  }
  .custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  /* 侧边栏动画 */
  .sidebar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar-collapsed {
    width: 64px !important;
  }
  .sidebar-expanded {
    width: 15% !important;
  }

  /* 文本淡入淡出 */
  .fade-text {
    transition: opacity 0.3s ease-in-out;
  }
  .fade-text.hidden {
    opacity: 0;
    pointer-events: none;
  }

  /* 玻璃态效果 */
  .glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* 卡片悬停效果 */
  .card-hover {
    transition: all 0.3s ease;
  }
  .card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  }

  /* 状态指示器 */
  .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
  }
  .status-online { background: #10b981; }
  .status-offline { background: #ef4444; }
  .status-connecting { background: #f59e0b; animation: pulse 2s infinite; }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }

  /* 输入框焦点效果 */
  .input-focus {
    transition: all 0.3s ease;
  }
  .input-focus:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }

  /* 按钮动画 */
  .btn-primary {
    background: var(--primary-gradient);
    transition: all 0.3s ease;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  }

  /* 开关组件 */
  .toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  .toggle-switch.active {
    background: #667eea;
  }
  .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
  }
  .toggle-switch.active::after {
    transform: translateX(24px);
  }
}
